package tsing.javase.designpattern.responsebility;

//主管审批实现
public class DirectorApprovalHandler extends ApprovalHandler {


    @Override
    public void nextHandler(ApprovalHandler approvalHandler) {
        super.nextHandler(approvalHandler);
    }

    @Override
    public void approval(HandleContext context) {
        System.out.println("主管审批");
        // do something
        context.setFlag(false);
        context.setCode(500);
        context.setMsg("主管不同意");
        if(context.getFlag()){
            invokeNext(context);
        }
    }

    @Override
    protected void invokeNext(HandleContext context) {
        super.invokeNext(context);
    }


}
